package cn.wolfcode._IOday01_.text006;

public class Text {
    public static void main(String[] args) {
        String str1 = "tip：保存代码是优秀习惯" ;
        char c = str1.charAt(2);
        int p = str1.indexOf('p');
        System.out.println(c);
        System.out.println(p);
        String str2= "tip：保存代码是优秀习惯";
        int i = str2.indexOf("优秀");
        System.out.println(i);
        String substring = str2.substring(i, i+2);
        System.out.println(substring);
    }
}
